*For coholders: How balances differ between 
*i) no cohold days
*ii) light cohold days
*iii) intense cohold days
eststo aa: quietly estpost summarize ///
month_total_income month_reg_income month_irr_income month_salary /// //income
ca_bal sa_bal ccard_bal /// //balances
ca_lim sa_lim ccard_lim /// //balances limits
total_fin_cost drattarv fit kostn2 /// //fees etc
od_amount utvextir /// //overdraft
cash liquidity  /// //liquidity
cons1 cons2 od_exp /// //relative to average expenditures
w1_total_exp w1_nec w1_unnec /// //expenditure supercategories
dur nondur tempt /// //expenditure supercategories
if CoholdDayDegree==1 & coholder==1, detail

eststo bb: quietly estpost summarize ///
month_total_income month_reg_income month_irr_income month_salary /// //income
ca_bal sa_bal ccard_bal /// //balances
ca_lim sa_lim ccard_lim /// //balances limits
total_fin_cost drattarv fit kostn2 /// //fees etc
od_amount utvextir /// //overdraft
cash liquidity  /// //liquidity
cons1 cons2 od_exp /// //relative to average expenditures
w1_total_exp w1_nec w1_unnec /// //expenditure supercategories
dur nondur tempt /// //expenditure supercategories
if CoholdDayDegree==2 & coholder==1, detail

eststo cc: quietly estpost summarize ///
month_total_income month_reg_income month_irr_income month_salary /// //income
ca_bal sa_bal ccard_bal /// //balances
ca_lim sa_lim ccard_lim /// //balances limits
total_fin_cost drattarv fit kostn2 /// //fees etc
od_amount utvextir /// //overdraft
cash liquidity  /// //liquidity
cons1 cons2 od_exp /// //relative to average expenditures
w1_total_exp w1_nec w1_unnec /// //expenditure supercategories
dur nondur tempt /// //expenditure supercategories
if CoholdDayDegree==3 & coholder==1, detail

eststo diffaa: quietly estpost ttest ///
month_total_income month_reg_income month_irr_income month_salary /// //income
ca_bal sa_bal ccard_bal /// //balances
ca_lim sa_lim ccard_lim /// //balances limits
total_fin_cost drattarv fit kostn2 /// //fees etc
od_amount utvextir /// //overdraft
cash liquidity  /// //liquidity
cons1 cons2 od_exp /// //relative to average expenditures
w1_total_exp w1_nec w1_unnec /// //expenditure supercategories
dur nondur tempt /// //expenditure supercategories
if CoholdDayDegree==1 & coholder==1 | CoholdDayDegree==2 & coholder==1, ///
by(CoholdDayDegree)

eststo diffbb: quietly estpost ttest ///
month_total_income month_reg_income month_irr_income month_salary /// //income
ca_bal sa_bal ccard_bal /// //balances
ca_lim sa_lim ccard_lim /// //balances limits
total_fin_cost drattarv fit kostn2 /// //fees etc
od_amount utvextir /// //overdraft
cash liquidity  /// //liquidity
cons1 cons2 od_exp /// //relative to average expenditures
w1_total_exp w1_nec w1_unnec /// //expenditure supercategories
dur nondur tempt /// //expenditure supercategories
if CoholdDayDegree==1 & coholder==1 | CoholdDayDegree==3 & coholder==1, ///
by(CoholdDayDegree)

esttab aa bb cc diffaa diffbb using "Tables/CoholdDayDegree1.tex", replace ///
cells("mean(label(Mean) pattern(1 1 1 0 0) fmt(%15.0fc)) p25(label(P25) pattern(1 1 1 0 0) fmt(%15.0fc)) p50(label(P50) pattern(1 1 1 0 0) fmt(%15.0fc)) p75(label(P75) pattern(1 1 1 0 0) fmt(%15.0fc)) p90(label(P90) pattern(1 1 1 0 0) fmt(%15.0fc)) b(label(Diff.) star pattern(0 0 0 1 1) fmt(%15.0fc)) se(label(SE) par pattern(0 0 0 1 1) fmt(%15.0fc))") ///
mtitle("No cohold days" "Light cohold days" "Intense cohold days" "No - light cohold days" "No - intense cohold days") ///
booktabs noobs nonumbers ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
rename( ///
month_total_income "?quad Total income$^1$" month_reg_income "?quad Regular income$^1$" ///
month_irr_income "?quad Irregular income$^1$" month_salary "?quad Salary$^1$" ///
total_fin_cost "?quad Total financial cost" ///
ca_bal "?quad Current account balance" ///
sa_bal "?quad Savings account balance" ///
ccard_bal "?quad Credit card balance" ///
ca_lim "?quad Current account limit" ///
sa_lim "?quad Savings account limit" ///
ccard_lim "?quad Credit card limit" ///
utvextir "?quad Overdraft interest" ///
od_amount "?quad Overdraft" cash "?quad Cash" ///
unnec_od "?quad Unnecessary overdraft" ///
liquidity "?quad Liquidity" ///
cons1 "?quad Cash (cons. days)" cons2 "?quad Liquidity (cons. days)" ///
od_exp "?quad Overdraft (cons. days)" ///
drattarv "?quad Late-payment interest" ///
fit "?quad Non-sufficient funds fees" kostn2 "?quad Late fees" ///
w1_total_exp "?quad Total expenditures$^2$" w1_nec "?quad Necessities$^2$" ///
w1_unnec "?quad Non-necessities$^2$" ///
dur "?quad Durables" ///
nondur "?quad Non-durables" ///
tempt "?quad Temptations" ///
) ///
substitute(? \) 

********************************************************************************
*Same as above except 
*all balances normalized by individual-specific average monthly income
eststo aa: quietly estpost summarize ///
month_total_income_rel month_reg_income_rel month_irr_income_rel month_salary_rel /// //income
ca_bal_rel sa_bal_rel ccard_bal_rel /// //balances
ca_lim_rel sa_lim_rel ccard_lim_rel /// //balances limits
total_fin_cost_rel drattarv_rel fit_rel kostn2_rel /// //fees etc
od_amount_rel utvextir_rel /// //overdraft
cash_rel liquidity_rel  /// //liquidity
cons1_rel cons2_rel od_exp_rel /// //relative to average expenditures
total_exp_rel nec_rel unnec_rel /// //expenditure supercategories
dur_rel nondur_rel tempt_rel /// //expenditure supercategories
if CoholdDayDegree==1 & coholder==1, detail

eststo bb: quietly estpost summarize ///
month_total_income_rel month_reg_income_rel month_irr_income_rel month_salary_rel /// //income
ca_bal_rel sa_bal_rel ccard_bal_rel /// //balances
ca_lim_rel sa_lim_rel ccard_lim_rel /// //balances limits
total_fin_cost_rel drattarv_rel fit_rel kostn2_rel /// //fees etc
od_amount_rel utvextir_rel /// //overdraft
cash_rel liquidity_rel  /// //liquidity
cons1_rel cons2_rel od_exp_rel /// //relative to average expenditures
total_exp_rel nec_rel unnec_rel /// //expenditure supercategories
dur_rel nondur_rel tempt_rel /// //expenditure supercategories
if CoholdDayDegree==2 & coholder==1, detail

eststo cc: quietly estpost summarize ///
month_total_income_rel month_reg_income_rel month_irr_income_rel month_salary_rel /// //income
ca_bal_rel sa_bal_rel ccard_bal_rel /// //balances
ca_lim_rel sa_lim_rel ccard_lim_rel /// //balances limits
total_fin_cost_rel drattarv_rel fit_rel kostn2_rel /// //fees etc
od_amount_rel utvextir_rel /// //overdraft
cash_rel liquidity_rel  /// //liquidity
cons1_rel cons2_rel od_exp_rel /// //relative to average expenditures
total_exp_rel nec_rel unnec_rel /// //expenditure supercategories
dur_rel nondur_rel tempt_rel /// //expenditure supercategories
if CoholdDayDegree==3 & coholder==1, detail

eststo diffaa: quietly estpost ttest ///
month_total_income_rel month_reg_income_rel month_irr_income_rel month_salary_rel /// //income
ca_bal_rel sa_bal_rel ccard_bal_rel /// //balances
ca_lim_rel sa_lim_rel ccard_lim_rel /// //balances limits
total_fin_cost_rel drattarv_rel fit_rel kostn2_rel /// //fees etc
od_amount_rel utvextir_rel /// //overdraft
cash_rel liquidity_rel  /// //liquidity
cons1_rel cons2_rel od_exp_rel /// //relative to average expenditures
total_exp_rel nec_rel unnec_rel /// //expenditure supercategories
dur_rel nondur_rel tempt_rel /// //expenditure supercategories
if CoholdDayDegree==1 & coholder==1 | CoholdDayDegree==2 & coholder==1, ///
by(CoholdDayDegree)

eststo diffbb: quietly estpost ttest ///
month_total_income_rel month_reg_income_rel month_irr_income_rel month_salary_rel /// //income
ca_bal_rel sa_bal_rel ccard_bal_rel /// //balances
ca_lim_rel sa_lim_rel ccard_lim_rel /// //balances limits
total_fin_cost_rel drattarv_rel fit_rel kostn2_rel /// //fees etc
od_amount_rel utvextir_rel /// //overdraft
cash_rel liquidity_rel  /// //liquidity
cons1_rel cons2_rel od_exp_rel /// //relative to average expenditures
total_exp_rel nec_rel unnec_rel /// //expenditure supercategories
dur_rel nondur_rel tempt_rel /// //expenditure supercategories
if CoholdDayDegree==1 & coholder==1 | CoholdDayDegree==3 & coholder==1, ///
by(CoholdDayDegree)

esttab aa bb cc diffaa diffbb using "Tables/CoholdDayDegree2.tex", replace ///
cells("mean(label(Mean) pattern(1 1 1 0 0) fmt(%15.2fc)) p25(label(P25) pattern(1 1 1 0 0) fmt(%15.2fc)) p50(label(P50) pattern(1 1 1 0 0) fmt(%15.2fc)) p75(label(P75) pattern(1 1 1 0 0) fmt(%15.2fc)) p90(label(P90) pattern(1 1 1 0 0) fmt(%15.2fc)) b(label(Diff.) star pattern(0 0 0 1 1) fmt(%15.2fc)) se(label(SE) par pattern(0 0 0 1 1) fmt(%15.2fc))") ///
mtitle("No cohold days" "Light cohold days" "Intense cohold days" "No - light cohold days" "No - intense cohold days") ///
booktabs noobs nonumbers ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
rename( ///
month_total_income_rel "?quad Total income$^1$" ///
month_reg_income_rel "?quad Regular income$^1$" ///
month_irr_income_rel "?quad Irregular income$^1$" ///
month_salary_rel "?quad Salary$^1$" ///
total_fin_cost_rel "?quad Total financial cost" ///
ca_bal_rel "?quad Current account balance" ///
sa_bal_rel "?quad Savings account balance" ///
ccard_bal_rel "?quad Credit card balance" ///
ca_lim_rel "?quad Current account limit" ///
sa_lim_rel "?quad Savings account limit" ///
ccard_lim_rel "?quad Credit card limit" ///
utvextir_rel "?quad Overdraft interest" ///
od_amount_rel "?quad Overdraft" ///
cash_rel "?quad Cash" ///
unnec_od_rel "?quad Unnecessary overdraft" ///
liquidity_rel "?quad Liquidity" ///
cons1_rel "?quad Cash (cons. days)" ///
cons2_rel "?quad Liquidity (cons. days)" ///
od_exp_rel "?quad Overdraft (cons. days)" ///
drattarv_rel "?quad Late-payment interest" ///
fit_rel "?quad Non-sufficient funds fees" ///
kostn2_rel "?quad Late fees" ///
total_exp_rel "?quad Total expenditures" ///
nec_rel "?quad Necessities" ///
unnec_rel "?quad Non-necessities" ///
dur_rel "?quad Durables" ///
nondur_rel "?quad Non-durables" ///
tempt_rel "?quad Temptations" ///
) ///
substitute(? \) 

********************************************************************************



********************************************************************************
*Looking at the subsample of intense coholder
********************************************************************************

********************************************************************************
***Intense coholders: Income does not vary within individual-months
eststo a: quietly estpost summarize ///
month_total_income_rel month_reg_income_rel month_irr_income_rel month_salary_rel /// //income
ca_bal_rel sa_bal_rel ccard_bal_rel /// //balances
ca_lim_rel sa_lim_rel ccard_lim_rel /// //balances limits
total_fin_cost_rel drattarv_rel fit_rel kostn2_rel /// //fees etc
od_amount_rel utvextir_rel /// //overdraft
cash_rel liquidity_rel  /// //liquidity
cons1_rel cons2_rel od_exp_rel /// //relative to average expenditures
total_exp_rel nec_rel unnec_rel /// //expenditure supercategories
dur_rel nondur_rel tempt_rel /// //expenditure supercategories
if CoholdDayDegree==1 & intense_coholder==1, detail

eststo b: quietly estpost summarize ///
month_total_income_rel month_reg_income_rel month_irr_income_rel month_salary_rel /// //income
ca_bal_rel sa_bal_rel ccard_bal_rel /// //balances
ca_lim_rel sa_lim_rel ccard_lim_rel /// //balances limits
total_fin_cost_rel drattarv_rel fit_rel kostn2_rel /// //fees etc
od_amount_rel utvextir_rel /// //overdraft
cash_rel liquidity_rel  /// //liquidity
cons1_rel cons2_rel od_exp_rel /// //relative to average expenditures
total_exp_rel nec_rel unnec_rel /// //expenditure supercategories
dur_rel nondur_rel tempt_rel /// //expenditure supercategories
if CoholdDayDegree==2 & intense_coholder==1, detail

eststo c: quietly estpost summarize ///
month_total_income_rel month_reg_income_rel month_irr_income_rel month_salary_rel /// //income
ca_bal_rel sa_bal_rel ccard_bal_rel /// //balances
ca_lim_rel sa_lim_rel ccard_lim_rel /// //balances limits
total_fin_cost_rel drattarv_rel fit_rel kostn2_rel /// //fees etc
od_amount_rel utvextir_rel /// //overdraft
cash_rel liquidity_rel  /// //liquidity
cons1_rel cons2_rel od_exp_rel /// //relative to average expenditures
total_exp_rel nec_rel unnec_rel /// //expenditure supercategories
dur_rel nondur_rel tempt_rel /// //expenditure supercategories
if CoholdDayDegree==3 & intense_coholder==1, detail

eststo diffa: quietly estpost ttest ///
month_total_income_rel month_reg_income_rel month_irr_income_rel month_salary_rel /// //income
ca_bal_rel sa_bal_rel ccard_bal_rel /// //balances
ca_lim_rel sa_lim_rel ccard_lim_rel /// //balances limits
total_fin_cost_rel drattarv_rel fit_rel kostn2_rel /// //fees etc
od_amount_rel utvextir_rel /// //overdraft
cash_rel liquidity_rel  /// //liquidity
cons1_rel cons2_rel od_exp_rel /// //relative to average expenditures
total_exp_rel nec_rel unnec_rel /// //expenditure supercategories
dur_rel nondur_rel tempt_rel /// //expenditure supercategories
if CoholdDayDegree==1 & intense_coholder==1 ///
| CoholdDayDegree==2 & intense_coholder==1, by(CoholdDayDegree)

eststo diffb: quietly estpost ttest ///
month_total_income_rel month_reg_income_rel month_irr_income_rel month_salary_rel /// //income
ca_bal_rel sa_bal_rel ccard_bal_rel /// //balances
ca_lim_rel sa_lim_rel ccard_lim_rel /// //balances limits
total_fin_cost_rel drattarv_rel fit_rel kostn2_rel /// //fees etc
od_amount_rel utvextir_rel /// //overdraft
cash_rel liquidity_rel  /// //liquidity
cons1_rel cons2_rel od_exp_rel /// //relative to average expenditures
total_exp_rel nec_rel unnec_rel /// //expenditure supercategories
dur_rel nondur_rel tempt_rel /// //expenditure supercategories
if CoholdDayDegree==1 & intense_coholder==1 ///
| CoholdDayDegree==3 & intense_coholder==1, by(CoholdDayDegree)

esttab a b c diffa diffb using "Tables/CoholdDayDegreeForIntense1.tex", replace ///
cells("mean(label(Mean) pattern(1 1 1 0 0) fmt(%15.2fc)) p25(label(P25) pattern(1 1 1 0 0) fmt(%15.2fc)) p50(label(P50) pattern(1 1 1 0 0) fmt(%15.2fc)) p75(label(P75) pattern(1 1 1 0 0) fmt(%15.2fc)) p90(label(P90) pattern(1 1 1 0 0) fmt(%15.2fc)) b(label(Diff.) star pattern(0 0 0 1 1) fmt(%15.2fc)) se(label(SE) par pattern(0 0 0 1 1) fmt(%15.2fc))") ///
mtitle("No cohold days" "Light cohold days" "Intense cohold days" "No - light cohold days" "No - intense cohold days") ///
booktabs noobs nonumbers ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
rename( ///
month_total_income_rel "?quad Total income$^1$" ///
month_reg_income_rel "?quad Regular income$^1$" ///
month_irr_income_rel "?quad Irregular income$^1$" ///
month_salary_rel "?quad Salary$^1$" ///
total_fin_cost_rel "?quad Total financial cost" ///
ca_bal_rel "?quad Current account balance" ///
sa_bal_rel "?quad Savings account balance" ///
ccard_bal_rel "?quad Credit card balance" ///
ca_lim_rel "?quad Current account limit" ///
sa_lim_rel "?quad Savings account limit" ///
ccard_lim_rel "?quad Credit card limit" ///
utvextir_rel "?quad Overdraft interest" ///
od_amount_rel "?quad Overdraft" ///
cash_rel "?quad Cash" ///
unnec_od_rel "?quad Unnecessary overdraft" ///
liquidity_rel "?quad Liquidity" ///
cons1_rel "?quad Cash (cons. days)" ///
cons2_rel "?quad Liquidity (cons. days)" ///
od_exp_rel "?quad Overdraft (cons. days)" ///
drattarv_rel "?quad Late-payment interest" ///
fit_rel "?quad Non-sufficient funds fees" ///
kostn2_rel "?quad Late fees" ///
total_exp_rel "?quad Total expenditures" ///
nec_rel "?quad Necessities" ///
unnec_rel "?quad Non-necessities" ///
dur_rel "?quad Durables" ///
nondur_rel "?quad Non-durables" ///
tempt_rel "?quad Temptations" ///
) ///
substitute(? \) 



********************************************************************************


********************************************************************************
*Coholder types
********************************************************************************
eststo a: quietly estpost summarize ///
age female spouse ///
month_total_income_mean month_reg_income_mean month_irr_income_mean month_salary_mean ///
ca_bal_mean sa_bal_mean ccard_bal_mean ///
ca_lim_mean sa_lim_mean ccard_lim_mean ///
total_fin_cost_mean drattarv_mean fit_mean kostn2_mean ///
od_amount_mean utvextir_mean ///
cash_mean liquidity_mean ///
cons1_mean cons2_mean od_exp_mean ///
total_exp_mean nec_mean unnec_mean ///
dur_mean nondur_mean tempt_mean ///
if cohold_type == 1 & edate_id==1335 //no coholder

eststo b: quietly estpost summarize ///
age female spouse ///
month_total_income_mean month_reg_income_mean month_irr_income_mean month_salary_mean ///
ca_bal_mean sa_bal_mean ccard_bal_mean ///
ca_lim_mean sa_lim_mean ccard_lim_mean ///
total_fin_cost_mean drattarv_mean fit_mean kostn2_mean ///
od_amount_mean utvextir_mean ///
cash_mean liquidity_mean ///
cons1_mean cons2_mean od_exp_mean ///
total_exp_mean nec_mean unnec_mean ///
dur_mean nondur_mean tempt_mean ///
if cohold_type == 2 & edate_id==1335 //infrequent coholder (<50% of time coholding)

eststo c: quietly estpost summarize ///
age female spouse ///
month_total_income_mean month_reg_income_mean month_irr_income_mean month_salary_mean ///
ca_bal_mean sa_bal_mean ccard_bal_mean ///
ca_lim_mean sa_lim_mean ccard_lim_mean ///
total_fin_cost_mean drattarv_mean fit_mean kostn2_mean ///
od_amount_mean utvextir_mean ///
cash_mean liquidity_mean ///
cons1_mean cons2_mean od_exp_mean ///
total_exp_mean nec_mean unnec_mean ///
dur_mean nondur_mean tempt_mean ///
if cohold_type == 3 & edate_id==1335 //frequent coholder (>50% of time coholding)

eststo diffa: quietly estpost ttest ///
age female spouse ///
month_total_income_mean month_reg_income_mean month_irr_income_mean month_salary_mean ///
ca_bal_mean sa_bal_mean ccard_bal_mean ///
ca_lim_mean sa_lim_mean ccard_lim_mean ///
total_fin_cost_mean drattarv_mean fit_mean kostn2_mean ///
od_amount_mean utvextir_mean ///
cash_mean liquidity_mean ///
cons1_mean cons2_mean od_exp_mean ///
total_exp_mean nec_mean unnec_mean ///
dur_mean nondur_mean tempt_mean ///
if cohold_type==1 & edate_id==1335 ///
| cohold_type==2 & edate_id==1335 ///
, by(cohold_type)

eststo diffb: quietly estpost ttest ///
age female spouse ///
month_total_income_mean month_reg_income_mean month_irr_income_mean month_salary_mean ///
ca_bal_mean sa_bal_mean ccard_bal_mean ///
ca_lim_mean sa_lim_mean ccard_lim_mean ///
total_fin_cost_mean drattarv_mean fit_mean kostn2_mean ///
od_amount_mean utvextir_mean ///
cash_mean liquidity_mean ///
cons1_mean cons2_mean od_exp_mean ///
total_exp_mean nec_mean unnec_mean ///
dur_mean nondur_mean tempt_mean ///
if cohold_type==1 & edate_id==1335 ///
| cohold_type==3 & edate_id==1335 ///
, by(cohold_type)

esttab a b c diffa diffb using "Tables/CoholdType.tex", replace ///
cells("mean(label(Mean) pattern(1 1 1 0 0) fmt(%15.1fc)) sd(label(Standard dev.) par pattern(1 1 1 0 0) fmt(%15.1fc)) b(label(Diff.) star pattern(0 0 0 1 1) fmt(%15.1fc)) se(label(Std. error) par pattern(0 0 0 1 1) fmt(%15.1fc)) count(label(\#obs) pattern(0 0 0 1 1) fmt(%15.0fc))") ///
mtitle("No coholder" "Infrequent coholder" "Frequent coholder" "No - infrequent coholder" "No - frequent coholder") ///
noobs booktabs ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
rename(age "?quad Age" female "?quad Female" spouse "?quad Spouse" ///
month_total_income_mean "?quad Total income$^1$" ///
month_reg_income_mean "?quad Regular income$^1$" ///
month_irr_income_mean "?quad Irregular income$^1$" ///
month_salary_mean "?quad Salary$^1$" ///
total_fin_cost_mean "?quad Total financial cost" ///
ca_bal_mean "?quad Current account balance" ///
sa_bal_mean "?quad Savings account balance" ///
ccard_bal_mean "?quad Credit card balance" ///
ca_lim_mean "?quad Current account limit" ///
sa_lim_mean "?quad Savings account limit" ///
ccard_lim_mean "?quad Credit card limit" ///
utvextir_mean "?quad Overdraft interest" ///
od_amount_mean "?quad Overdraft" ///
cash_mean "?quad Cash" ///
unnec_od_mean "?quad Unnecessary overdraft" ///
liquidity_mean "?quad Liquidity" ///
cons1_mean "?quad Cash (cons. days)" ///
cons2_mean "?quad Liquidity (cons. days)" ///
od_exp_mean "?quad Overdraft (cons. days)" ///
drattarv_mean "?quad Late-payment interest" ///
fit_mean "?quad Non-sufficient funds fees" ///
kostn2_mean "?quad Late fees" ///
total_exp_mean "?quad Total expenditures" ///
nec_mean "?quad Necessities" ///
unnec_mean "?quad Non-necessities" ///
dur_mean "?quad Durables" ///
nondur_mean "?quad Non-durables" ///
tempt_mean "?quad Temptations" ///
) ///
substitute(? \) 





********************************************************************************
*Differences between days with no, short, long cohold periods
********************************************************************************

*Create cohold duration degree variable
gen CoholdDurDegree = 1 if cohold_day==0
replace CoholdDurDegree = 2 if cohold_day==1 & _end==1 & _seq <=30
replace CoholdDurDegree = 3 if cohold_day==1 & _end==1 & _seq >30

bysort ind_spell_id: egen CoholdDurDegreeSeq = max(CoholdDurDegree)
replace CoholdDurDegree = CoholdDurDegreeSeq
drop CoholdDurDegreeSeq

eststo aa: quietly estpost summarize ///
month_total_income_rel month_reg_income_rel month_irr_income_rel month_salary_rel /// //income
ca_bal_rel sa_bal_rel ccard_bal_rel /// //balances
ca_lim_rel sa_lim_rel ccard_lim_rel /// //balances limits
total_fin_cost_rel drattarv_rel fit_rel kostn2_rel /// //fees etc
od_amount_rel utvextir_rel /// //overdraft
cash_rel liquidity_rel  /// //liquidity
cons1_rel cons2_rel od_exp_rel /// //relative to average expenditures
total_exp_rel nec_rel unnec_rel /// //expenditure supercategories
dur_rel nondur_rel tempt_rel /// //expenditure supercategories
if CoholdDurDegree==1 & coholder==1, detail

eststo bb: quietly estpost summarize ///
month_total_income_rel month_reg_income_rel month_irr_income_rel month_salary_rel /// //income
ca_bal_rel sa_bal_rel ccard_bal_rel /// //balances
ca_lim_rel sa_lim_rel ccard_lim_rel /// //balances limits
total_fin_cost_rel drattarv_rel fit_rel kostn2_rel /// //fees etc
od_amount_rel utvextir_rel /// //overdraft
cash_rel liquidity_rel  /// //liquidity
cons1_rel cons2_rel od_exp_rel /// //relative to average expenditures
total_exp_rel nec_rel unnec_rel /// //expenditure supercategories
dur_rel nondur_rel tempt_rel /// //expenditure supercategories
if CoholdDurDegree==2 & coholder==1, detail

eststo cc: quietly estpost summarize ///
month_total_income_rel month_reg_income_rel month_irr_income_rel month_salary_rel /// //income
ca_bal_rel sa_bal_rel ccard_bal_rel /// //balances
ca_lim_rel sa_lim_rel ccard_lim_rel /// //balances limits
total_fin_cost_rel drattarv_rel fit_rel kostn2_rel /// //fees etc
od_amount_rel utvextir_rel /// //overdraft
cash_rel liquidity_rel  /// //liquidity
cons1_rel cons2_rel od_exp_rel /// //relative to average expenditures
total_exp_rel nec_rel unnec_rel /// //expenditure supercategories
dur_rel nondur_rel tempt_rel /// //expenditure supercategories
if CoholdDurDegree==3 & coholder==1, detail

eststo diffaa: quietly estpost ttest ///
month_total_income_rel month_reg_income_rel month_irr_income_rel month_salary_rel /// //income
ca_bal_rel sa_bal_rel ccard_bal_rel /// //balances
ca_lim_rel sa_lim_rel ccard_lim_rel /// //balances limits
total_fin_cost_rel drattarv_rel fit_rel kostn2_rel /// //fees etc
od_amount_rel utvextir_rel /// //overdraft
cash_rel liquidity_rel  /// //liquidity
cons1_rel cons2_rel od_exp_rel /// //relative to average expenditures
total_exp_rel nec_rel unnec_rel /// //expenditure supercategories
dur_rel nondur_rel tempt_rel /// //expenditure supercategories
if CoholdDurDegree==1 & coholder==1 | CoholdDurDegree==2 & coholder==1, ///
by(CoholdDurDegree)

eststo diffbb: quietly estpost ttest ///
month_total_income_rel month_reg_income_rel month_irr_income_rel month_salary_rel /// //income
ca_bal_rel sa_bal_rel ccard_bal_rel /// //balances
ca_lim_rel sa_lim_rel ccard_lim_rel /// //balances limits
total_fin_cost_rel drattarv_rel fit_rel kostn2_rel /// //fees etc
od_amount_rel utvextir_rel /// //overdraft
cash_rel liquidity_rel  /// //liquidity
cons1_rel cons2_rel od_exp_rel /// //relative to average expenditures
total_exp_rel nec_rel unnec_rel /// //expenditure supercategories
dur_rel nondur_rel tempt_rel /// //expenditure supercategories
if CoholdDurDegree==1 & coholder==1 | CoholdDurDegree==3  & coholder==1, ///
by(CoholdDurDegree)

esttab aa bb cc diffaa diffbb using "Tables/CoholdDurDegree1.tex", replace ///
cells("mean(label(Mean) pattern(1 1 1 0 0) fmt(%15.2fc)) p25(label(P25) pattern(1 1 1 0 0) fmt(%15.2fc)) p50(label(P50) pattern(1 1 1 0 0) fmt(%15.2fc)) p75(label(P75) pattern(1 1 1 0 0) fmt(%15.2fc)) p90(label(P90) pattern(1 1 1 0 0) fmt(%15.2fc)) b(label(Diff.) star pattern(0 0 0 1 1) fmt(%15.2fc)) se(label(SE) par pattern(0 0 0 1 1) fmt(%15.2fc))") ///
mtitle("No cohold days" "Cohold days in short cohold period" "Cohold days in long cohold period" "No - short cohold period" "No - long cohold period") ///
booktabs noobs nonumbers ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
rename( ///
month_total_income_rel "?quad Total income$^1$" ///
month_reg_income_rel "?quad Regular income$^1$" ///
month_irr_income_rel "?quad Irregular income$^1$" ///
month_salary_rel "?quad Salary$^1$" ///
total_fin_cost_rel "?quad Total financial cost" ///
ca_bal_rel "?quad Current account balance" ///
sa_bal_rel "?quad Savings account balance" ///
ccard_bal_rel "?quad Credit card balance" ///
ca_lim_rel "?quad Current account limit" ///
sa_lim_rel "?quad Savings account limit" ///
ccard_lim_rel "?quad Credit card limit" ///
utvextir_rel "?quad Overdraft interest" ///
od_amount_rel "?quad Overdraft" ///
cash_rel "?quad Cash" ///
unnec_od_rel "?quad Unnecessary overdraft" ///
liquidity_rel "?quad Liquidity" ///
cons1_rel "?quad Cash (cons. days)" ///
cons2_rel "?quad Liquidity (cons. days)" ///
od_exp_rel "?quad Overdraft (cons. days)" ///
drattarv_rel "?quad Late-payment interest" ///
fit_rel "?quad Non-sufficient funds fees" ///
kostn2_rel "?quad Late fees" ///
total_exp_rel "?quad Total expenditures" ///
nec_rel "?quad Necessities" ///
unnec_rel "?quad Non-necessities" ///
dur_rel "?quad Durables" ///
nondur_rel "?quad Non-durables" ///
tempt_rel "?quad Temptations" ///
) ///
substitute(? \) 











********************************************************************************
*How balances change when coholding starts or ends
********************************************************************************

 

eststo a: quietly estpost summarize ///
total_income_dchange reg_income_dchange irr_income_dchange salary_dchange /// //income
ca_bal_dchange sa_bal_dchange ccard_bal_dchange /// //balances
ca_lim_dchange sa_lim_dchange ccard_lim_dchange /// //balances limits
total_fin_cost_dchange drattarv_dchange fit_dchange kostn2_dchange /// //fees etc
od_amount_dchange utvextir_dchange /// //overdraft
cash_dchange liquidity_dchange  /// //liquidity
cons1_dchange cons2_dchange od_exp_dchange /// //relative to average expenditures
total_exp_dchange nec_dchange unnec_dchange /// //expenditure supercategories
dur_dchange nondur_dchange tempt_dchange ///
if cohold_spell_cat == 1, detail

eststo b: quietly estpost summarize ///
total_income_dchange reg_income_dchange irr_income_dchange salary_dchange /// //income
ca_bal_dchange sa_bal_dchange ccard_bal_dchange /// //balances
ca_lim_dchange sa_lim_dchange ccard_lim_dchange /// //balances limits
total_fin_cost_dchange drattarv_dchange fit_dchange kostn2_dchange /// //fees etc
od_amount_dchange utvextir_dchange /// //overdraft
cash_dchange liquidity_dchange  /// //liquidity
cons1_dchange cons2_dchange od_exp_dchange /// //relative to average expenditures
total_exp_dchange nec_dchange unnec_dchange /// //expenditure supercategories
dur_dchange nondur_dchange tempt_dchange ///
if cohold_spell_cat == 5, detail

eststo diff: estpost ttest ///
total_income_dchange reg_income_dchange irr_income_dchange salary_dchange /// //income
ca_bal_dchange sa_bal_dchange ccard_bal_dchange /// //balances
ca_lim_dchange sa_lim_dchange ccard_lim_dchange /// //balances limits
total_fin_cost_dchange drattarv_dchange fit_dchange kostn2_dchange /// //fees etc
od_amount_dchange utvextir_dchange /// //overdraft
cash_dchange liquidity_dchange  /// //liquidity
cons1_dchange cons2_dchange od_exp_dchange /// //relative to average expenditures
total_exp_dchange nec_dchange unnec_dchange /// //expenditure supercategories
dur_dchange nondur_dchange tempt_dchange ///
if cohold_spell_cat==1 ///
| cohold_spell_cat==5 ///
, by(cohold_spell_cat)

esttab a b diff using "Tables/CoholdDayStart1.tex", replace ///
cells("mean(label(Mean) pattern(1 1 0) fmt(%15.0fc)) p25(label(P25) pattern(1 1 0) fmt(%15.0fc)) p50(label(P50) pattern(1 1 0) fmt(%15.0fc)) p75(label(P75) pattern(1 1 0) fmt(%15.0fc)) p90(label(P90) pattern(1 1 0) fmt(%15.0fc)) b(label(Diff.) star pattern(0 0 1) fmt(%15.0fc)) se(label(SE) par pattern(0 0 1) fmt(%15.0fc))") ///
mtitle("Cohold starts" "Cohold ends" "") ///
noobs booktabs ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
rename( ///
total_income_dchange "?quad Total income" ///
reg_income_dchange "?quad Regular income" ///
irr_income_dchange "?quad Irregular income" ///
salary_dchange "?quad Salary" ///
total_fin_cost_dchange "?quad Total financial cost" ///
ca_bal_dchange "?quad Current account balance" ///
sa_bal_dchange "?quad Savings account balance" ///
ccard_bal_dchange "?quad Credit card balance" ///
ca_lim_dchange "?quad Current account limit" ///
sa_lim_dchange "?quad Savings account limit" ///
ccard_lim_dchange "?quad Credit card limit" ///
utvextir_dchange "?quad Overdraft interest" ///
od_amount_dchange "?quad Overdraft" ///
cash_dchange "?quad Cash" ///
unnec_od_dchange "?quad Unnecessary overdraft" ///
liquidity_dchange "?quad Liquidity" ///
cons1_dchange "?quad Cash (cons. days)" ///
cons2_dchange "?quad Liquidity (cons. days)" ///
od_exp_dchange "?quad Overdraft (cons. days)" ///
drattarv_dchange "?quad Late-payment interest" ///
fit_dchange "?quad Non-sufficient funds fees" ///
kostn2_dchange "?quad Late fees" ///
total_exp_dchange "?quad Total expenditures" ///
nec_dchange "?quad Necessities" ///
unnec_dchange "?quad Non-necessities" ///
dur_dchange "?quad Durables" ///
nondur_dchange "?quad Non-durables" ///
tempt_dchange "?quad Temptations" ///
) ///
substitute(? \) 



eststo a: quietly estpost summarize ///
total_income_rdchange reg_income_rdchange irr_income_rdchange salary_rdchange /// //income
ca_bal_rdchange sa_bal_rdchange ccard_bal_rdchange /// //balances
ca_lim_rdchange sa_lim_rdchange ccard_lim_rdchange /// //balances limits
total_fin_cost_rdchange drattarv_rdchange fit_rdchange kostn2_rdchange /// //fees etc
od_amount_rdchange utvextir_rdchange /// //overdraft
cash_rdchange liquidity_rdchange  /// //liquidity
cons1_rdchange cons2_rdchange od_exp_rdchange /// //relative to average expenditures
total_exp_rdchange nec_rdchange unnec_rdchange /// //expenditure supercategories
dur_rdchange nondur_rdchange tempt_rdchange ///
if cohold_spell_cat == 1, detail

eststo b: quietly estpost summarize ///
total_income_rdchange reg_income_rdchange irr_income_rdchange salary_rdchange /// //income
ca_bal_rdchange sa_bal_rdchange ccard_bal_rdchange /// //balances
ca_lim_rdchange sa_lim_rdchange ccard_lim_rdchange /// //balances limits
total_fin_cost_rdchange drattarv_rdchange fit_rdchange kostn2_rdchange /// //fees etc
od_amount_rdchange utvextir_rdchange /// //overdraft
cash_rdchange liquidity_rdchange  /// //liquidity
cons1_rdchange cons2_rdchange od_exp_rdchange /// //relative to average expenditures
total_exp_rdchange nec_rdchange unnec_rdchange /// //expenditure supercategories
dur_rdchange nondur_rdchange tempt_rdchange ///
if cohold_spell_cat == 5, detail

eststo diff: estpost ttest ///
total_income_rdchange reg_income_rdchange irr_income_rdchange salary_rdchange /// //income
ca_bal_rdchange sa_bal_rdchange ccard_bal_rdchange /// //balances
ca_lim_rdchange sa_lim_rdchange ccard_lim_rdchange /// //balances limits
total_fin_cost_rdchange drattarv_rdchange fit_rdchange kostn2_rdchange /// //fees etc
od_amount_rdchange utvextir_rdchange /// //overdraft
cash_rdchange liquidity_rdchange  /// //liquidity
cons1_rdchange cons2_rdchange od_exp_rdchange /// //relative to average expenditures
total_exp_rdchange nec_rdchange unnec_rdchange /// //expenditure supercategories
dur_rdchange nondur_rdchange tempt_rdchange ///
if cohold_spell_cat==1 ///
| cohold_spell_cat==5 ///
, by(cohold_spell_cat)

esttab a b diff using "Tables/CoholdDayStart2.tex", replace ///
cells("mean(label(Mean) pattern(1 1 0) fmt(%15.2fc)) p25(label(P25) pattern(1 1 0) fmt(%15.2fc)) p50(label(P50) pattern(1 1 0) fmt(%15.2fc)) p75(label(P75) pattern(1 1 0) fmt(%15.2fc)) p90(label(P90) pattern(1 1 0) fmt(%15.2fc)) b(label(Diff.) star pattern(0 0 1) fmt(%15.2fc)) se(label(SE) par pattern(0 0 1) fmt(%15.2fc))") ///
mtitle("Cohold starts" "Cohold ends" "") ///
noobs booktabs ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
rename( ///
total_income_rdchange "?quad Total income" ///
reg_income_rdchange "?quad Regular income" ///
irr_income_rdchange "?quad Irregular income" ///
salary_rdchange "?quad Salary" ///
total_fin_cost_rdchange "?quad Total financial cost" ///
ca_bal_rdchange "?quad Current account balance" ///
sa_bal_rdchange "?quad Savings account balance" ///
ccard_bal_rdchange "?quad Credit card balance" ///
ca_lim_rdchange "?quad Current account limit" ///
sa_lim_rdchange "?quad Savings account limit" ///
ccard_lim_rdchange "?quad Credit card limit" ///
utvextir_rdchange "?quad Overdraft interest" ///
od_amount_rdchange "?quad Overdraft" ///
cash_rdchange "?quad Cash" ///
unnec_od_rdchange "?quad Unnecessary overdraft" ///
liquidity_rdchange "?quad Liquidity" ///
cons1_rdchange "?quad Cash (cons. days)" ///
cons2_rdchange "?quad Liquidity (cons. days)" ///
od_exp_rdchange "?quad Overdraft (cons. days)" ///
drattarv_rdchange "?quad Late-payment interest" ///
fit_rdchange "?quad Non-sufficient funds fees" ///
kostn2_rdchange "?quad Late fees" ///
total_exp_rdchange "?quad Total expenditures" ///
nec_rdchange "?quad Necessities" ///
unnec_rdchange "?quad Non-necessities" ///
dur_rdchange "?quad Durables" ///
nondur_rdchange "?quad Non-durables" ///
tempt_rdchange "?quad Temptations" ///
) ///
substitute(? \) 


********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************

*How balances change across coholder types at start and end, provided they cohold

********************************************************************************
*Daily balances
eststo a: quietly estpost summarize ///
total_income_dchange reg_income_dchange irr_income_dchange salary_dchange /// //income
ca_bal_dchange sa_bal_dchange ccard_bal_dchange /// //balances
ca_lim_dchange sa_lim_dchange ccard_lim_dchange /// //balances limits
total_fin_cost_dchange drattarv_dchange fit_dchange kostn2_dchange /// //fees etc
od_amount_dchange utvextir_dchange /// //overdraft
cash_dchange liquidity_dchange  /// //liquidity
cons1_dchange cons2_dchange od_exp_dchange /// //relative to average expenditures
total_exp_dchange nec_dchange unnec_dchange /// //expenditure supercategories
dur_dchange nondur_dchange tempt_dchange ///
if cohold_type == 2 & cohold_spell_cat ==1

eststo b: quietly estpost summarize ///
total_income_dchange reg_income_dchange irr_income_dchange salary_dchange /// //income
ca_bal_dchange sa_bal_dchange ccard_bal_dchange /// //balances
ca_lim_dchange sa_lim_dchange ccard_lim_dchange /// //balances limits
total_fin_cost_dchange drattarv_dchange fit_dchange kostn2_dchange /// //fees etc
od_amount_dchange utvextir_dchange /// //overdraft
cash_dchange liquidity_dchange  /// //liquidity
cons1_dchange cons2_dchange od_exp_dchange /// //relative to average expenditures
total_exp_dchange nec_dchange unnec_dchange /// //expenditure supercategories
dur_dchange nondur_dchange tempt_dchange ///
if cohold_type == 3 & cohold_spell_cat ==1

eststo c: quietly estpost summarize ///
total_income_dchange reg_income_dchange irr_income_dchange salary_dchange /// //income
ca_bal_dchange sa_bal_dchange ccard_bal_dchange /// //balances
ca_lim_dchange sa_lim_dchange ccard_lim_dchange /// //balances limits
total_fin_cost_dchange drattarv_dchange fit_dchange kostn2_dchange /// //fees etc
od_amount_dchange utvextir_dchange /// //overdraft
cash_dchange liquidity_dchange  /// //liquidity
cons1_dchange cons2_dchange od_exp_dchange /// //relative to average expenditures
total_exp_dchange nec_dchange unnec_dchange /// //expenditure supercategories
dur_dchange nondur_dchange tempt_dchange ///
if cohold_type == 2 & cohold_spell_cat ==5

eststo d: quietly estpost summarize ///
total_income_dchange reg_income_dchange irr_income_dchange salary_dchange /// //income
ca_bal_dchange sa_bal_dchange ccard_bal_dchange /// //balances
ca_lim_dchange sa_lim_dchange ccard_lim_dchange /// //balances limits
total_fin_cost_dchange drattarv_dchange fit_dchange kostn2_dchange /// //fees etc
od_amount_dchange utvextir_dchange /// //overdraft
cash_dchange liquidity_dchange  /// //liquidity
cons1_dchange cons2_dchange od_exp_dchange /// //relative to average expenditures
total_exp_dchange nec_dchange unnec_dchange /// //expenditure supercategories
dur_dchange nondur_dchange tempt_dchange ///
if cohold_type == 3 & cohold_spell_cat ==5

eststo diffa: quietly estpost ttest ///
total_income_dchange reg_income_dchange irr_income_dchange salary_dchange /// //income
ca_bal_dchange sa_bal_dchange ccard_bal_dchange /// //balances
ca_lim_dchange sa_lim_dchange ccard_lim_dchange /// //balances limits
total_fin_cost_dchange drattarv_dchange fit_dchange kostn2_dchange /// //fees etc
od_amount_dchange utvextir_dchange /// //overdraft
cash_dchange liquidity_dchange  /// //liquidity
cons1_dchange cons2_dchange od_exp_dchange /// //relative to average expenditures
total_exp_dchange nec_dchange unnec_dchange /// //expenditure supercategories
dur_dchange nondur_dchange tempt_dchange ///
if cohold_type==2 & cohold_spell_cat ==1 ///
| cohold_type==3 & cohold_spell_cat ==1 ///
, by(cohold_type)

eststo diffb: quietly estpost ttest ///
total_income_dchange reg_income_dchange irr_income_dchange salary_dchange /// //income
ca_bal_dchange sa_bal_dchange ccard_bal_dchange /// //balances
ca_lim_dchange sa_lim_dchange ccard_lim_dchange /// //balances limits
total_fin_cost_dchange drattarv_dchange fit_dchange kostn2_dchange /// //fees etc
od_amount_dchange utvextir_dchange /// //overdraft
cash_dchange liquidity_dchange  /// //liquidity
cons1_dchange cons2_dchange od_exp_dchange /// //relative to average expenditures
total_exp_dchange nec_dchange unnec_dchange /// //expenditure supercategories
dur_dchange nondur_dchange tempt_dchange ///
if cohold_type==2 & cohold_spell_cat ==5 ///
| cohold_type==3 & cohold_spell_cat ==5 ///
, by(cohold_type)

esttab a b c d diffa diffb using "Tables/CoholdingStartEnd1.tex", replace ///
cells("mean(label(Mean) pattern(1 1 1 1 0 0) fmt(%15.0fc)) sd(label(Standard dev.) par pattern(1 1 1 1 0 0) fmt(%15.0fc)) b(label(Diff.) star pattern(0 0 0 0 1 1) fmt(%15.0fc)) se(label(Std. error) par pattern(0 0 0 0 1 1) fmt(%15.0fc))") ///
mtitle("Light start" "Intense start" "Light end" "Intense end" "Light - intense start" "Light - intense end") ///
noobs booktabs ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
rename( ///
total_income_dchange "?quad Total income" ///
reg_income_dchange "?quad Regular income" ///
irr_income_dchange "?quad Irregular income" ///
salary_dchange "?quad Salary" ///
total_fin_cost_dchange "?quad Total financial cost" ///
ca_bal_dchange "?quad Current account balance" ///
sa_bal_dchange "?quad Savings account balance" ///
ccard_bal_dchange "?quad Credit card balance" ///
ca_lim_dchange "?quad Current account limit" ///
sa_lim_dchange "?quad Savings account limit" ///
ccard_lim_dchange "?quad Credit card limit" ///
utvextir_dchange "?quad Overdraft interest" ///
od_amount_dchange "?quad Overdraft" ///
cash_dchange "?quad Cash" ///
unnec_od_dchange "?quad Unnecessary overdraft" ///
liquidity_dchange "?quad Liquidity" ///
cons1_dchange "?quad Cash (cons. days)" ///
cons2_dchange "?quad Liquidity (cons. days)" ///
od_exp_dchange "?quad Overdraft (cons. days)" ///
drattarv_dchange "?quad Late-payment interest" ///
fit_dchange "?quad Non-sufficient funds fees" ///
kostn2_dchange "?quad Late fees" ///
total_exp_dchange "?quad Total expenditures" ///
nec_dchange "?quad Necessities" ///
unnec_dchange "?quad Non-necessities" ///
dur_dchange "?quad Durables" ///
nondur_dchange "?quad Non-durables" ///
tempt_dchange "?quad Temptations" ///
) ///
substitute(? \) 



*Daily balances
eststo a: quietly estpost summarize ///
total_income_rdchange reg_income_rdchange irr_income_rdchange salary_rdchange /// //income
ca_bal_rdchange sa_bal_rdchange ccard_bal_rdchange /// //balances
ca_lim_rdchange sa_lim_rdchange ccard_lim_rdchange /// //balances limits
total_fin_cost_rdchange drattarv_rdchange fit_rdchange kostn2_rdchange /// //fees etc
od_amount_rdchange utvextir_rdchange /// //overdraft
cash_rdchange liquidity_rdchange  /// //liquidity
cons1_rdchange cons2_rdchange od_exp_rdchange /// //relative to average expenditures
total_exp_rdchange nec_rdchange unnec_rdchange /// //expenditure supercategories
dur_rdchange nondur_rdchange tempt_rdchange ///
if cohold_type == 2 & cohold_spell_cat ==1

eststo b: quietly estpost summarize ///
total_income_rdchange reg_income_rdchange irr_income_rdchange salary_rdchange /// //income
ca_bal_rdchange sa_bal_rdchange ccard_bal_rdchange /// //balances
ca_lim_rdchange sa_lim_rdchange ccard_lim_rdchange /// //balances limits
total_fin_cost_rdchange drattarv_rdchange fit_rdchange kostn2_rdchange /// //fees etc
od_amount_rdchange utvextir_rdchange /// //overdraft
cash_rdchange liquidity_rdchange  /// //liquidity
cons1_rdchange cons2_rdchange od_exp_rdchange /// //relative to average expenditures
total_exp_rdchange nec_rdchange unnec_rdchange /// //expenditure supercategories
dur_rdchange nondur_rdchange tempt_rdchange ///
if cohold_type == 3 & cohold_spell_cat ==1

eststo c: quietly estpost summarize ///
total_income_rdchange reg_income_rdchange irr_income_rdchange salary_rdchange /// //income
ca_bal_rdchange sa_bal_rdchange ccard_bal_rdchange /// //balances
ca_lim_rdchange sa_lim_rdchange ccard_lim_rdchange /// //balances limits
total_fin_cost_rdchange drattarv_rdchange fit_rdchange kostn2_rdchange /// //fees etc
od_amount_rdchange utvextir_rdchange /// //overdraft
cash_rdchange liquidity_rdchange  /// //liquidity
cons1_rdchange cons2_rdchange od_exp_rdchange /// //relative to average expenditures
total_exp_rdchange nec_rdchange unnec_rdchange /// //expenditure supercategories
dur_rdchange nondur_rdchange tempt_rdchange ///
if cohold_type == 2 & cohold_spell_cat ==5

eststo d: quietly estpost summarize ///
total_income_rdchange reg_income_rdchange irr_income_rdchange salary_rdchange /// //income
ca_bal_rdchange sa_bal_rdchange ccard_bal_rdchange /// //balances
ca_lim_rdchange sa_lim_rdchange ccard_lim_rdchange /// //balances limits
total_fin_cost_rdchange drattarv_rdchange fit_rdchange kostn2_rdchange /// //fees etc
od_amount_rdchange utvextir_rdchange /// //overdraft
cash_rdchange liquidity_rdchange  /// //liquidity
cons1_rdchange cons2_rdchange od_exp_rdchange /// //relative to average expenditures
total_exp_rdchange nec_rdchange unnec_rdchange /// //expenditure supercategories
dur_rdchange nondur_rdchange tempt_rdchange ///
if cohold_type == 3 & cohold_spell_cat ==5

eststo diffa: quietly estpost ttest ///
total_income_rdchange reg_income_rdchange irr_income_rdchange salary_rdchange /// //income
ca_bal_rdchange sa_bal_rdchange ccard_bal_rdchange /// //balances
ca_lim_rdchange sa_lim_rdchange ccard_lim_rdchange /// //balances limits
total_fin_cost_rdchange drattarv_rdchange fit_rdchange kostn2_rdchange /// //fees etc
od_amount_rdchange utvextir_rdchange /// //overdraft
cash_rdchange liquidity_rdchange  /// //liquidity
cons1_rdchange cons2_rdchange od_exp_rdchange /// //relative to average expenditures
total_exp_rdchange nec_rdchange unnec_rdchange /// //expenditure supercategories
dur_rdchange nondur_rdchange tempt_rdchange ///
if cohold_type==2 & cohold_spell_cat ==1 ///
| cohold_type==3 & cohold_spell_cat ==1 ///
, by(cohold_type)

eststo diffb: quietly estpost ttest ///
total_income_rdchange reg_income_rdchange irr_income_rdchange salary_rdchange /// //income
ca_bal_rdchange sa_bal_rdchange ccard_bal_rdchange /// //balances
ca_lim_rdchange sa_lim_rdchange ccard_lim_rdchange /// //balances limits
total_fin_cost_rdchange drattarv_rdchange fit_rdchange kostn2_rdchange /// //fees etc
od_amount_rdchange utvextir_rdchange /// //overdraft
cash_rdchange liquidity_rdchange  /// //liquidity
cons1_rdchange cons2_rdchange od_exp_rdchange /// //relative to average expenditures
total_exp_rdchange nec_rdchange unnec_rdchange /// //expenditure supercategories
dur_rdchange nondur_rdchange tempt_rdchange ///
if cohold_type==2 & cohold_spell_cat ==5 ///
| cohold_type==3 & cohold_spell_cat ==5 ///
, by(cohold_type)

esttab a b c d diffa diffb using "Tables/CoholdingStartEnd2.tex", replace ///
cells("mean(label(Mean) pattern(1 1 1 1 0 0) fmt(%15.2fc)) sd(label(Standard dev.) par pattern(1 1 1 1 0 0) fmt(%15.2fc)) b(label(Diff.) star pattern(0 0 0 0 1 1) fmt(%15.2fc)) se(label(Std. error) par pattern(0 0 0 0 1 1) fmt(%15.2fc))") ///
mtitle("Light start" "Intense start" "Light end" "Intense end" "Light - intense start" "Light - intense end") ///
noobs booktabs ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
rename( ///
total_income_rdchange "?quad Total income" ///
reg_income_rdchange "?quad Regular income" ///
irr_income_rdchange "?quad Irregular income" ///
salary_rdchange "?quad Salary" ///
total_fin_cost_rdchange "?quad Total financial cost" ///
ca_bal_rdchange "?quad Current account balance" ///
sa_bal_rdchange "?quad Savings account balance" ///
ccard_bal_rdchange "?quad Credit card balance" ///
ca_lim_rdchange "?quad Current account limit" ///
sa_lim_rdchange "?quad Savings account limit" ///
ccard_lim_rdchange "?quad Credit card limit" ///
utvextir_rdchange "?quad Overdraft interest" ///
od_amount_rdchange "?quad Overdraft" ///
cash_rdchange "?quad Cash" ///
unnec_od_rdchange "?quad Unnecessary overdraft" ///
liquidity_rdchange "?quad Liquidity" ///
cons1_rdchange "?quad Cash (cons. days)" ///
cons2_rdchange "?quad Liquidity (cons. days)" ///
od_exp_rdchange "?quad Overdraft (cons. days)" ///
drattarv_rdchange "?quad Late-payment interest" ///
fit_rdchange "?quad Non-sufficient funds fees" ///
kostn2_rdchange "?quad Late fees" ///
total_exp_rdchange "?quad Total expenditures" ///
nec_rdchange "?quad Necessities" ///
unnec_rdchange "?quad Non-necessities" ///
dur_rdchange "?quad Durables" ///
nondur_rdchange "?quad Non-durables" ///
tempt_rdchange "?quad Temptations" ///
) ///
substitute(? \) 



